<?php 
require_once 'xywx_jssdk.php';

$yourAppID = 'wx2bf4e8db2a511e45';
$yourAppSecret = '31665213bb4cb43ec5a349ac48073e2b';

//获取密匙并验证
$weid = trim($_GET['weid']);
$wekey = trim($_GET['wekey']);
$ts = trim($_GET['ts']);
$sign = trim($_GET['sign']);

$string = "weid=$weid&wekey=$wekey&ts=$ts";

if(md5(strtolower($string)) === $sign && $weid==='weclouds' && $wekey === 'xy123456'){

	$jssdk = new JSSDK( $yourAppID, $yourAppSecret);
	$jsApiTicket = $jssdk->getJsApiTicket();

	echo $jsApiTicket;
}else{
	echo 'no right to access.';
}


?>